#include "rapter/typedefs.h"                        // _2d, _3d namespaces
#include "rapter/util/parse.h"                      // rapter::console

#include "rapter/optimization/problemSetup.h"
#include "rapter/optimization/impl/problemSetup.hpp"
#include "rapter/primitives/impl/planePrimitive.hpp"

int formulate3D( int argc, char** argv )
{
    if ( rapter::console::find_switch(argc,argv,"--formulate3D") )
    {
        return rapter::ProblemSetup::formulateCli< rapter::_3d::PrimitiveContainerT
                                              , rapter::PointContainerT
                                              , rapter::_3d::PrimitiveT
                                              , rapter::PointPrimitiveT
                                              , rapter::_3d::MyFinitePlaneToFinitePlaneCompatFunctor
                                              >( argc, argv );
    }
    else
    {
        std::cerr << "[" << __func__ << "]: " << "switch error" << std::endl;
        return EXIT_FAILURE;
    }
}
template int
rapter::ProblemSetup::myFormulateCli< rapter::_3d::PrimitiveContainerT
                                                  , rapter::PointContainerT
                                                  , rapter::_3d::PrimitiveT
                                                  , rapter::PointPrimitiveT
                                                  , rapter::_3d::MyFinitePlaneToFinitePlaneCompatFunctor
                                                  >(
                    std::string                 cloud_path,
                    std::string                 candidates_path,                //candidates_it%d.csv
                    std::string                 assoc_path,                     //points_primitives.csv
                    bool                        verbose,
                    float                       scalar,
                    float                       unary,                          //1e5
                    float                       pw,                             //0.01 --pairwise
                    float                       cmp,                            //0
                    std::string                 cost_string,                    //spatsqrt  --cost-fn
                    int                         srand_val,                      //123456  --srand
                    std::string                 problem_rel_path,               //"problem" --rod
                    AnglesT                     angle_gens,                     //-angle-gen
                    float                       dir_id_bias,                    //0
                    std::string                 data_cost_mode_str,             //"assoc"
                    std::string                 constr_mode_str,                //"patch" #see the code for more information;
                    float                       patch_population_limit,         //10 --patch-pop-limit
                    float                       collapseAngleDeg,               //0.4  --collapse-angle-deg
                    std::string                 energy_path,                    //"energy.csv"
                    float                       freq_weight,                    //0
                    int                         clustersMode,                   //0 --no-clusters
                    float                       spatial_weight_coeff,           // pw/10 --spat-weight
                    float                       spatial_weight_dist_mult,       //2 --spat-dist-mult
                    bool                        useAngleGen,                    //false     --use-angle-gen
                    float                       truncAngle,                     //15    --trunc-angle
                    bool                        no_paral                        //false
                    );
